package edu.jit.flowers.service;

import java.util.List;

import edu.jit.flowers.bean.Orders;
import edu.jit.flowers.dao.OrdersDAO;

public class OrdersService {
	private OrdersDAO oDao=new OrdersDAO();
	//添加订单
	public int addOrders(Orders o) {
		return oDao.addOrders(o);
	}
	//删除订单
	public int deleteOrders(Orders o) {
		return oDao.deleteOrdersById(o);
	}
	//修改订单总数
	public int updateOrdersTotalById(Orders o) {
		return oDao.updateOrdersTotalById(o);
	}
	//修改订单状态
	 public int updateOrdersStatusById(Orders o) {
		 return oDao.updateOrdersStatusById(o);
	 }
	//根据id查询所有订单
	 public List<Orders> getAllOrdersById(){
	    	return oDao.selectAllById();
	 }
	    //根据用户名查所有订单
	 public List<Orders> getAllOrdersByUName(String username){
	    	return oDao.selectAllByUName(username);
	 }
	 //查看所有订单
	 
	 public List<Orders> getAllOrders(){
		 	return oDao.selectAll();
	 }
	 	    
}
